/**
 * 
 */
package view;

import java.io.File;

import javax.swing.filechooser.FileFilter;


public class FiltroXML extends FileFilter {

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
	 */
	@Override
	public boolean accept(File f) {
		if (f.isDirectory()) {
			return true;
		}
		String extension = Utils.getExtension(f);
		if (extension != null) {
			if (extension.equals(Utils.xder)) {
				return true;
			} else {
				return false;
			}
		}

		return false;
	}

	/* (non-Javadoc)
	 * @see javax.swing.filechooser.FileFilter#getDescription()
	 */
	@Override
	public String getDescription() {
		return "Solo archivos .xder";
	}

}
